package com.nmsl.util.R;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {
    private int code;
    private String msg;
    private Object data;


    public static R ok(Object data) {
        return new R(200,"操作成功",data);
    }

    public static R fail(String msg) {
        return new R(300,msg,null);
    }
    public static R error(String msg) {
        return new R(500,msg,null);
    }
}
